import authMenuList from "@/assets/json/authMenuList.json";
// import { PORT3 } from "@/api/config/servicePort";
import { http } from "@/api";

/**
 * @use 上传文件
 */
export const uploadExcelsApi = (params: any, file: any) => {
  return http.post<any>(`/api/v1/rbac/file/excelimport`, file, {
    params: params,
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8"
    }
  });
};

/**
 * @use 上传文件
 */
export const uploadExcelApi = (params: any, file: any) => {
  return http.post<any>(`/api/v1/rbac/file/excelimportone`, file, {
    params: params,
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8"
    }
  });
};

/**
 * @use 获取历史记录列表
 */
export const gettasklistApi = (params: any) => {
  return http.get(`api/v1/rbac/task/gettasklist`, { params: params });
};

/**
 * @use 获取历史记录列表详情
 */
export const gettaskinfoApi = (params: any) => {
  return http.get(`/api/v1/rbac/task/gettaskinfo`, { params });
};

/**
 * @use 获取ai文字
 */
export const getAIcontentApi = () => {
  return http.get(`/api/v1/rbac/home/getindex`);
};

/**
 * @use 上传文件暂停|重启
 */
export const getPauseApi = (par: any, params: any) => {
  return http.post(`api/v1/rbac/task/settaskstatus`, par, { params });
};

/**
 * @use 获取菜单列表
 */
export const getAuthMenuListApi = () => {
  // return ownHttp.get<Menu.MenuOptions[]>(`/user/sq/config/menu.info`);
  // 如果想让菜单变为本地数据，注释上一行代码，并引入本地 authMenuList.json 数据
  return authMenuList;
};
/******************************************************************************************************* */

/**
 * @use 获取微信列表（绑定）
 */
export const getWxBindListApi = (params: any) => {
  return http.post(`/api/v1/rbac/asset/getassetlist`, null, { params });
};

/**
 * @use 获取微信列表2（绑定）
 */
export const getwxlistApi = (params: any) => {
  return http.post(`/api/v1/rbac/asset/getwxlist`, null, { params, loading: false });
};

/**
 * @use 微信绑定
 */
export const wxBindApi = (params: any) => {
  return http.post(`/api/v1/rbac/user/wxlogin`, null, { params, loading: false });
};

/**
 * @use 获取二维码
 */
export const getcodeApi = (params: any) => {
  return http.get(`/api/v1/rbac/user/getcode`, { params, loading: false });
};


/**
 * @use 获取截屏
 */
export const getwindowsApi = (params: any) => {
  return http.post(`/api/v1/rbac/home/getwindows`, null, { params });
};


/**
 * @use 获取微信绑定状态
 */
export const getWxStatusApi = (params: any) => {
  return http.post(`/api/v1/rbac/user/getstatus`, null, { params: params, loading: false });
};

/**
 * @use 获取系统设置参数列表
 */
export const getconfigApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/getconfig`, null, { params });
};

/**
 * @use 新增系统设置参数
 */
export const addconfigApi = (params: any) => {
  return http.post(`/api/v1/rbac/user/setconfig`, params);
};

/**
 * @use 获取参数选项
 */
export const getdicApi = (params?: any) => {
  return http.post(`/api/v1/rbac/data/getdic`, null, { params });
};

/**
 * @use 微信号共享
 */
export const isShareApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/setshare`, null, { params });
};

/**
 * @use 获取用户协议列表
 */
export const getcontractlistApi = (params?: any) => {
  return http.get(`/api/v1/rbac/user/getcontractlist`);
};

/**
 * @use 签约
 */
export const setcontractApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/setcontract`, null, { params });
};

/**
 * @use 获取系统设置参数列表
 */
export const getconfigdicApi = (params?: any) => {
  return http.get(`/api/v1/rbac/user/getconfigdic`);
};

/**
 * @use 获取获取策略明细
 */
export const getconfiginfoApi = (params?: any) => {
  return http.get(`/api/v1/rbac/user/getconfiginfo`, { params, loading: false });
};

/**
 * @use 设置每个微信号的策略（配置）
 */
export const setitemconfigApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/setitemconfig`, null, { params, loading: false });
};

/**
 * @use 获取每个微信号的策略（配置）
 */
export const getitemconfigApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/getitemconfig`, null, { params, loading: false });
};

/**
 * @use 获取共享微信号列表(公海）
 */
export const getsharedwxlistApi = (params?: any) => {
  return http.get(`/api/v1/rbac/platform/getsharedwxlist`, { params });
};

/**
 * @use 获取共享微信号列表(私海）
 */
export const getmywxlistApi = (params?: any) => {
  return http.get(`/api/v1/rbac/platform/getmywxlist`, { params });
};

/**
 * @use 把账号导入私海共享池
 */
export const setmywxApi = (params?: any) => {
  return http.post(`/api/v1/rbac/platform/setmywx`, params);
};

/**
 * @use 获取用户通讯录
 */
export const getfriendshipApi = (params?: any) => {
  return http.get(`/api/v1/rbac/user/getfriendship`, { params, loading: false });
};

/**
 * @use 获取最近|新客户|群聊
 */
export const getmessagelistApi = (params?: any) => {
  return http.get(`/api/v1/message/getmessagelist`, { params, loading: false });
};

/**
 * @use 获取分组列表
 */
export const getgrouplistApi = (params?: any) => {
  return http.get(`/api/v1/rbac/asset/getgrouplist`, { params, loading: false });
};

/**
 * @use 新增分组
 */
export const setgroupApi = (params?: any) => {
  return http.post(`/api/v1/rbac/asset/setgroup`, null, { params });
};

/**
 * @use 查看微信分组下面的好友列表
 */
export const getgroupinfoApi = (params?: any) => {
  return http.get(`/api/v1/rbac/asset/getgroupinfo`, { params });
};

/**
 * @use 将微信好友放入分组中（批量）
 */
export const setwxtogroupApi = (params?: any) => {
  return http.post(`/api/v1/rbac/asset/setwxtogroup`, params);
};

/**
 * @use 查看微信分组下面的好友列表
 */
export const gettaginfoApi = (params?: any) => {
  return http.get(`/api/v1/rbac/asset/gettaginfo`, { params });
};

/**
 * @use 上传图片
 */
export const uploadImgApi = (file: any) => {
  return http.post<any>(`/api/v1/rbac/file/uploadfilesajax`, file, {
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8"
    }
  });
};

export const getKeyWordicApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/getdic`, null, { params, loading: false });
};

export const setKeyWordicApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/setdic`, null, { params, loading: false });
};

/**
 * @use 上传图片
 */
export const setfriendroundApi = (para: any) => {
  return http.post<any>(`/api/v1/rbac/asset/setfriendround`, para);
};

export const getmessageinfoApi = (params?: any) => {
  return http.post(`/api/v1/message/getmessageinfo`, null, { params, loading: false });
};

export const getlistOrganizeApi = (params?: any) => {
  return http.post(`/api/v1/rbac/organize/list`, params);
};

export const createOrganizeApi = (params?: any) => {
  return http.post(`/api/v1/rbac/organize/create`, params);
};

export const editOrganizeApi = (params?: any) => {
  return http.post(`/api/v1/rbac/organize/edit`, params);
};

export const deleteOrganizeApi = (params?: any) => {
  return http.get(`/api/v1/rbac/organize/delete/${params.id}`);
};

export const getuserApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/getuser`, null, { params, loading: false });
};

export const setuserApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/setuser`, null, { params, loading: false });
};

export const taskSingleCreateApi = (params?: any) => {
  return http.post(`/api/v1/rbac/task/create`, params);
};

export const deletedicApi = (params?: any) => {
  return http.post(`/api/v1/rbac/user/deletedic`, null, { params, loading: false });
};

export const submitwximportApi = (params?: any) => {
  return http.post(`/api/v1/rbac/task/submitwximport`, params);
};
